refactor!: remove deprecated APIs ahead of v14 stable#3086
Conversation
Remove 19 deprecated items from multiple major versions. BREAKING CHANGE: remove deprecated public APIs
|
Size Change: -4.19 kB (-0.68%) Total Size: 609 kB 📦 View Changed
ℹ️ View Unchanged
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3086 +/- ##
==========================================
+ Coverage 79.57% 80.44% +0.86%
==========================================
Files 426 414 -12
Lines 12181 11975 -206
Branches 3914 3862 -52
==========================================
- Hits 9693 9633 -60
+ Misses 2488 2342 -146 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| if (!lockChannelOrder) { | ||
| const channelIndex = channels.findIndex( | ||
| (channel) => channel.cid === event.cid, | ||
| ); | ||
| if (channelIndex <= 0) return channels; | ||
| const channel = channels[channelIndex]; | ||
| return uniqBy([channel, ...channels], 'cid'); | ||
| } |
There was a problem hiding this comment.
This should probably use moveChannelUpwards function.
Disregard, it was only used in one hook which was deprecated too and should've been removed (done in 19be5ab).
| last_read_at: '2023-12-15T11:49:21.667730943Z', | ||
| last_read_message_id: 'SmithAnne-jeIYWT39L56bs79f10Hao', | ||
| // @deprecated number of all unread messages across all my unread channels, equals unread_count | ||
| total_unread_count: 19, |
There was a problem hiding this comment.
@oliverlaz not sure why this is marked as deprecated, but I tested this and the WS event returns total_unread_count, so it should not be removed.
There was a problem hiding this comment.
I don't have the history here. I found it marked deprecated :)
The field is still returned by the WS backend and is not actually deprecated.
🎯 Goal
Remove 19 deprecated APIs that have accumulated over multiple major versions (some since v10) before the v14 stable release. This reduces public API surface area and eliminates dead code paths, fallback patterns, and runtime deprecation warnings.
🛠 Implementation details
Removed items grouped by category:
Pin Permissions (7 items)
pinPermissionsprop fromMessageContext,MessageProps,MessageListPropsPinEnabledUserRolesandPinPermissionstypesdefaultPinPermissionsconstant_permissionsparam fromusePinHandler(signature is now(message, notifications))Pagination Renames (6 items, #1804)
hasMore,hasMoreNewer,loadMore,loadMoreNewerfromInfiniteScroll— usehasPreviousPage,hasNextPage,loadPreviousPage,loadNextPagerefreshingfromLoadMoreButton,LoadMorePaginator,PaginatorProps— useisLoadingdeprecationAndReplacementWarningutility (zero callers remain)Components & Exports (4 items)
StreamEmojicomponentUploadButton/UploadButtonPropsexports toFileInput/FileInputPropslatestMessageprop fromChannelListItemUI— uselatestMessagePreviewpopperOptionsprop fromEmojiPicker— useplacementUtilities (2 items)
moveChannelUp(replaced bymoveChannelUpwards); updateduseMessageNewListenerhasNotMoreMessages(negated duplicate ofhasMoreMessagesProbably)ChannelList Event Listener Hooks (10 items)
useChannelDeletedListener,useChannelHiddenListener,useChannelTruncatedListener,useChannelUpdatedListener,useChannelVisibleListener,useMessageNewListener,useNotificationAddedToChannelListener,useNotificationMessageNewListener,useNotificationRemovedFromChannelListener,useUserPresenceChangedListenerChannelListcallback props (e.g.onChannelDeleted,onMessageNew, etc.) — channel list event handling is now managed internally by thestream-chatSDK'sChannelManagerBug fix
MessageList.tsxwhereloadMoreNewerwas incorrectly labeled as deprecatedSee
ai-docs/DEPRECATED_API_REMOVAL_PLAN.mdfor the full inventory and remaining items.⚠ Breaking Changes
pinPermissionspropchannelCapabilities(already used at runtime)PinPermissions,PinEnabledUserRolestypeschannelCapabilitiesdefaultPinPermissionsconstantchannelCapabilitiesusePinHandler(msg, permissions, notifications)usePinHandler(msg, notifications)hasMore/hasMoreNewer(InfiniteScroll)hasPreviousPage/hasNextPageloadMore/loadMoreNewer(InfiniteScroll)loadPreviousPage/loadNextPagerefreshing(LoadMoreButton, PaginatorProps)isLoadingStreamEmojicomponentmoveChannelUputilitymoveChannelUpwardsUploadButton/UploadButtonPropsFileInput/FileInputPropslatestMessageprop (ChannelListItemUI)latestMessagePreviewpopperOptionsprop (EmojiPicker)placementhasNotMoreMessageshasMoreMessagesProbablyuseChannelDeletedListenerhookuseChannelListShapeuseChannelHiddenListenerhookuseChannelTruncatedListenerhookuseChannelUpdatedListenerhookuseChannelVisibleListenerhookuseMessageNewListenerhookuseNotificationAddedToChannelListenerhookuseNotificationMessageNewListenerhookuseNotificationRemovedFromChannelListenerhookuseUserPresenceChangedListenerhook🎨 UI Changes
No visual changes — all removals are API-only.